bitkeeper revision 1.1159.1.153 (41495dc4v3GzGJz41U0jh2uqLzhlIw)
authorcl349@freefall.cl.cam.ac.uk <cl349@freefall.cl.cam.ac.uk>
Thu, 16 Sep 2004 09:32:52 +0000 (09:32 +0000)
committercl349@freefall.cl.cam.ac.uk <cl349@freefall.cl.cam.ac.uk>
Thu, 16 Sep 2004 09:32:52 +0000 (09:32 +0000)
Fix ping with large/fragmented packets from domU to dom0.

linux-2.6.8.1-xen-sparse/drivers/xen/netfront/netfront.c

index 44aa8e9ddefde742b9ccce091b699bf68cf87f3d..6de5cc51fdce13d61b0fd0a9f5255d67e10e73e4 100644 (file)
@@ -393,11 +393,12 @@ static int network_start_xmit(struct sk_buff *skb, struct net_device *dev)
     tx->size = skb->len;
 
     wmb(); /* Ensure that backend will see the request. */
-    np->tx->req_prod = i + 1;
+    i++;
+    np->tx->req_prod = i;
 
     network_tx_buf_gc(dev);
 
-    if ( (i - np->tx_resp_cons) == (NETIF_TX_RING_SIZE - 1) )
+    if ( (i - np->tx_resp_cons) == NETIF_TX_RING_SIZE )
     {
         np->tx_full = 1;
         netif_stop_queue(dev);
@@ -410,7 +411,7 @@ static int network_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
     /* Only notify Xen if there are no outstanding responses. */
     mb();
-    if ( np->tx->resp_prod == i )
+    if ( np->tx->resp_prod != i )
         notify_via_evtchn(np->evtchn);
 
     return 0;